<?php
/**
 * Yii view meta
 *
 * @author <KTD SOFT>
 * @since Apr 1, 2013 - 5:36:46 PM
 */
$input_id   = "PM_" . $model->id;
$input_name = "ProductMeta[$model->id]";
?>
<div class="formRow">
    <div class="span10">
        <div class="span3">

        </div>
        <div class="span6">
            <input type="hidden" placeholder="Đường dẫn file" 
                   name="<?php echo $input_name ?>[file]"
                   value="<?php echo $model->image ?>" 
                   id="<?php echo $input_id ?>" class="span12" />

            <?php
            $imgOption  = array(
                'id'              => "prv_$input_id",
                'style'           => 'max-height:200px;max-width:200px',
                'data-glisse-big' => $model->image,
                'class'           => 'tl',
                'rel'             => 'post',
            );
            echo CHtml::image($model->image, "", $imgOption);
            ?>
        </div>
        <?php if (isset($upload) && $upload == TRUE): ?>
            <div class="span2">
                <a onclick="<?php echo "return upload_file('$input_id', '$type', true)" ?>"
                   href="#" class="btn btn-primary">
                    <i class="icon-upload"></i>
                    Chọn file
                </a>
            </div>
        <?php endif; ?>
    </div>
    <div class="span2">
        <a class="btn btn-inverse" onclick="del_file($(this), false)" del_id='<?php echo $model->id ?>'>
            <i class="icon-remove"></i> 
            <?php echo Yii::t('form', 'Delete') ?>
        </a>
    </div>
</div>
<div class="clearfix"></div>